package com.dianping.cat.home.dal.report;

import org.unidal.dal.jdbc.DataField;
import org.unidal.dal.jdbc.QueryDef;
import org.unidal.dal.jdbc.QueryType;
import org.unidal.dal.jdbc.Readset;
import org.unidal.dal.jdbc.Updateset;
import org.unidal.dal.jdbc.annotation.Attribute;
import org.unidal.dal.jdbc.annotation.Entity;
import org.unidal.dal.jdbc.annotation.Variable;

@Entity(logicalName = "alteration", physicalName = "alteration", alias = "a")
public class AlterationEntity
{
  @Attribute(field = "id", nullable = false, primaryKey = true, autoIncrement = true)
/* 16 */   public static final DataField ID = new DataField("id");

  @Attribute(field = "type", nullable = false)
/* 19 */   public static final DataField TYPE = new DataField("type");

  @Attribute(field = "title", nullable = false)
/* 22 */   public static final DataField TITLE = new DataField("title");

  @Attribute(field = "domain", nullable = false)
/* 25 */   public static final DataField DOMAIN = new DataField("domain");

  @Attribute(field = "hostname", nullable = false)
/* 28 */   public static final DataField HOSTNAME = new DataField("hostname");

  @Attribute(field = "ip")
/* 31 */   public static final DataField IP = new DataField("ip");

  @Attribute(field = "date", nullable = false)
/* 34 */   public static final DataField DATE = new DataField("date");

  @Attribute(field = "user", nullable = false)
/* 37 */   public static final DataField USER = new DataField("user");

  @Attribute(field = "alt_group")
/* 40 */   public static final DataField ALT_GROUP = new DataField("alt-group");

  @Attribute(field = "content", nullable = false)
/* 43 */   public static final DataField CONTENT = new DataField("content");

  @Attribute(field = "url")
/* 46 */   public static final DataField URL = new DataField("url");

  @Attribute(field = "status")
/* 49 */   public static final DataField STATUS = new DataField("status");

  @Attribute(field = "creation_date", nullable = false, insertExpr = "NOW()")
/* 52 */   public static final DataField CREATION_DATE = new DataField("creation-date");

  @Variable
/* 55 */   public static final DataField KEY_ID = new DataField("key-id");

  @Variable
/* 58 */   public static final DataField START_TIME = new DataField("start-time");

  @Variable
/* 61 */   public static final DataField END_TIME = new DataField("end-time");

  @Variable
/* 64 */   public static final DataField TYPES = new DataField("types");

/* 66 */   public static final Readset<Alteration> READSET_FULL = new Readset(new DataField[] { ID, TYPE, TITLE, DOMAIN, HOSTNAME, IP, DATE, USER, ALT_GROUP, CONTENT, URL, STATUS, CREATION_DATE });

/* 68 */   public static final Updateset<Alteration> UPDATESET_FULL = new Updateset(new DataField[] { ID, TYPE, TITLE, DOMAIN, HOSTNAME, IP, DATE, USER, ALT_GROUP, CONTENT, URL, STATUS });

/* 70 */   public static final QueryDef FIND_BY_PK = new QueryDef("findByPK", AlterationEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 73 */   public static final QueryDef INSERT = new QueryDef("insert", AlterationEntity.class, QueryType.INSERT, "INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)");


/* 76 */   public static final QueryDef UPDATE_BY_PK = new QueryDef("updateByPK", AlterationEntity.class, QueryType.UPDATE, "UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='id'/> = ${key-id}");


/* 79 */   public static final QueryDef DELETE_BY_PK = new QueryDef("deleteByPK", AlterationEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 82 */   public static final QueryDef FIND_BY_TYPE_DRUATION = new QueryDef("findByTypeDruation", AlterationEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='date'/> >= ${start-time} AND <FIELD name='date'/> <= ${end-time} <IF type='NOT_NULL' field='type'> AND <FIELD name='type'/> = ${type} </IF> ORDER BY <FIELD name='date'/> desc");


/* 85 */   public static final QueryDef FIND_BY_DTDH = new QueryDef("findByDtdh", AlterationEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='date'/> >= ${start-time} AND <FIELD name='date'/> <= ${end-time} <IF type='NOT_NULL' field='type'> AND <FIELD name='type'/> = ${type} </IF> <IF type='NOT_NULL' field='domain'> AND <FIELD name='domain'/> = ${domain} </IF> <IF type='NOT_NULL' field='hostname'> AND <FIELD name='hostname'/> = ${hostname} </IF> ORDER BY <FIELD name='date'/> desc");


/* 88 */   public static final QueryDef FIND_BY_DTDH_TYPES = new QueryDef("findByDtdhTypes", AlterationEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='date'/> >= ${start-time} AND <FIELD name='date'/> <= ${end-time} <IF type='NOT_NULL' field='type'> AND <FIELD name='type'/> = ${type} </IF> <IF type='NOT_NULL' field='domain'> AND <FIELD name='domain'/> = ${domain} </IF> <IF type='NOT_NULL' field='hostname'> AND <FIELD name='hostname'/> = ${hostname} </IF> AND <FIELD name='type'/> in <IN>${types}</IN> ORDER BY <FIELD name='date'/> desc");


/* 91 */   public static final QueryDef FIND_BY_DOMAIN_AND_TIME = new QueryDef("findByDomainAndTime", AlterationEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='date'/> >= ${start-time} AND <FIELD name='date'/> <= ${end-time} <IF type='NOT_NULL' field='domain'> AND <FIELD name='domain'/> = ${domain} </IF> ORDER BY <FIELD name='date'/> desc");
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/dal/report/AlterationEntity.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */